﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Common/MasterPages/Blank.Master" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="ZHArchInfoList.aspx.cs" Inherits="DMS.Web.Modules.ArchivesManagement.ZHArchInfoList" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="diy" %>
<%@ Register Src="~/Common/Controls/Loading.ascx" TagName="Loading" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PageTitle" runat="server">
    基本信息
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="/Resources/Scripts/jquery.blockUI.js"></script>
    <script type="text/javascript" src="/Resources/Scripts/jquery-ui/ui/jquery.ui.core.min.js"></script>
	<script type="text/javascript" src="/Resources/Scripts/jquery-ui/ui/jquery.ui.widget.min.js"></script>
	<script type="text/javascript" src="/Resources/Scripts/jquery-ui/ui/jquery.ui.position.min.js"></script>
	<script type="text/javascript" src="/Resources/scripts/jquery-ui/ui/jquery.ui.mouse.min.js"></script>
    <script type="text/javascript" src="/Resources/scripts/jquery-ui/ui/jquery.ui.draggable.min.js"></script>
    <script type="text/javascript" src="/Resources/scripts/jquery-ui/ui/jquery.ui.button.min.js"></script>
    <script type="text/javascript" src="/Resources/scripts/jquery-ui/ui/jquery.ui.dialog.min.js"></script>
    <link rel="stylesheet" href="/Resources/Scripts/jquery-ui/themes/cupertino/jquery.ui.all.css">
    <%--<script type="text/javascript" src="/Resources/scripts/util.js"></script>--%>    
    <script type="text/javascript" language="javascript">
        
        function getClientIds() {
            return {
                Condition: '#<%= Condition.ClientID %>',
                btnSearch: '#<%= btnSearch.ClientID %>',
                exportBtn: '#<%= exportBtn.ClientID %>'
            };
        }

        $(document).ready(function () {
            $("#loading").dialog({
                resizable: false,
                height: 140,
                width: 110,
                modal: true,
                autoOpen: false,
                buttons: {

                }
            });

            $("#returnMessage").dialog({
                resizable: false,
                height: 320,
                width: 330,
                modal: true,
                autoOpen: false,
                title: "提示",
                buttons: {
                    "关闭": function () {
                        $(this).dialog("close");
                    }
                }
            });
        });
        
        function exportList() {
            window.open('/Resources/Templates/基本信息导入模板-单位.xls');
        }

        function deleteRecord(obj) {
            if (obj.id == 'hasChild') {
                alert('该基本信息下存在资料信息，无法删除！');
                return;
            }
            if (confirm('确定要删除该条记录？')) {
                $(obj).parents('tr').hide();
                alert('删除成功！');
            }
        }

        function GsCheck(obj) {
            if(obj.checked) {
                $('.fgs').hide();
                $('.gs').show();
            }else {
                $('.fgs').show();
                $('.gs').show();
            }

        }

        function searchForm() {
            $('#MainHolder_gvList tr').hide();
            $('.searchResult').show();
        }
    </script>
    <script type="text/javascript" src="/Modules/ArchivesManagement/Scripts/ZHArchInfoList.js"></script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainHolder" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <asp:HiddenField ID="Condition" runat="server"/>
    <div id="mainareacontent" style="overflow:auto;padding-top:5px;">
            <div class="search">
                <!----------- 查询信息 ------------------>
                <span style="padding: 5 0 5 5"><b>当前列表：<span style="color:red">综合资料信息</span></b></span>
                <table width="100%" cellpadding="0" cellspacing="0" style="padding: 5 0 5 5">
                    <tr>
                        <td class="form">
                            <table cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <th>
                                        所属年度：
                                    </th>
                                    <td>
                                        <asp:DropDownList ID="ddlBelongYear" runat="server" Width="55px">
                                            <asp:ListItem Value="" Text="全部"></asp:ListItem>
                                            <asp:ListItem Value="2014" Text="2014"></asp:ListItem>
                                            <asp:ListItem Value="2013" Text="2013"></asp:ListItem>
                                            <asp:ListItem Value="2012" Text="2012"></asp:ListItem>
                                            <asp:ListItem Value="2011" Text="2011"></asp:ListItem>
                                            <asp:ListItem Value="2010" Text="2010"></asp:ListItem>
                                            <asp:ListItem Value="2009" Text="2009"></asp:ListItem>
                                            <asp:ListItem Value="2008" Text="2008"></asp:ListItem>
                                            <asp:ListItem Value="2007" Text="2007"></asp:ListItem>
                                            <asp:ListItem Value="2006" Text="2006"></asp:ListItem>
                                            <asp:ListItem Value="2005" Text="2005"></asp:ListItem>
                                            <asp:ListItem Value="2004" Text="2004"></asp:ListItem>
                                            <asp:ListItem Value="2003" Text="2003"></asp:ListItem>
                                            <asp:ListItem Value="2002" Text="2002"></asp:ListItem>
                                            <asp:ListItem Value="2001" Text="2001"></asp:ListItem>
                                        </asp:DropDownList>
                                        年
                                       <%-- <asp:DropDownList ID="ddlBelongMonth" runat="server" Width="50px">
                                            <asp:ListItem Value="" Text="全部"></asp:ListItem>
                                            <asp:ListItem Value="1" Text="1"></asp:ListItem>
                                            <asp:ListItem Value="2" Text="2"></asp:ListItem>
                                            <asp:ListItem Value="3" Text="3"></asp:ListItem>
                                            <asp:ListItem Value="4" Text="4"></asp:ListItem>
                                            <asp:ListItem Value="5" Text="5"></asp:ListItem>
                                            <asp:ListItem Value="6" Text="6"></asp:ListItem>
                                            <asp:ListItem Value="7" Text="7"></asp:ListItem>
                                            <asp:ListItem Value="8" Text="8"></asp:ListItem>
                                            <asp:ListItem Value="9" Text="9"></asp:ListItem>
                                            <asp:ListItem Value="10" Text="10"></asp:ListItem>
                                            <asp:ListItem Value="11" Text="11"></asp:ListItem>
                                            <asp:ListItem Value="12" Text="12"></asp:ListItem>
                                        </asp:DropDownList>
                                        月--%>
                                    </td>                                    
                                    <th>
                                        档案名称：
                                    </th>
                                    <td>
                                        <asp:TextBox TextMode="MultiLine" Height="22px" ID="txtName" runat="server" Width="150px"></asp:TextBox>
                                    </td>
                                    <th>
                                        是否销毁：
                                    </th>
                                    <td>
                                        <asp:DropDownList ID="ddlDestroy" runat="server" Width="50px">
                                            <asp:ListItem Value="" Text="全部"></asp:ListItem>
                                            <asp:ListItem Value="True" Text="是"></asp:ListItem>
                                            <asp:ListItem Value="False" Selected="True" Text="否"></asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        形成日期：
                                    </th>
                                    <td>
                                        <asp:TextBox ID="txtInitDateBegin" onClick="WdatePicker()" runat="server" Width="70px"></asp:TextBox>
                                        至
                                        <asp:TextBox ID="txtInitDateEnd" onClick="WdatePicker()" runat="server" Width="70px"></asp:TextBox>
                                    </td>
                                    <th>
                                        保管起始日期：
                                    </th>
                                    <td>
                                        <asp:TextBox ID="txtBeginTimeBegin" onClick="WdatePicker()" runat="server" Width="70px"></asp:TextBox>
                                        至
                                        <asp:TextBox ID="txtBeginTimeEnd" onClick="WdatePicker()" runat="server" Width="70px"></asp:TextBox>
                                    </td>
                                    <th>
                                        到期日期：
                                    </th>
                                    <td>
                                        <asp:TextBox ID="txtExpireTimeBegin" onClick="WdatePicker()" runat="server" Width="70px"></asp:TextBox>
                                        至
                                        <asp:TextBox ID="txtExpireTimeEnd" onClick="WdatePicker()" runat="server" Width="70px"></asp:TextBox>
                                    </td>
                                </tr>                                
                            </table>
                        </td>
                    </tr>
                </table>
            </div>
        <div align="left" style="padding: 5 0 0 0">
            <span class="search"  style="padding: 2 0 2 2">
                <asp:CheckBox ID="CurrentPage" OnClick="CheckChange(this)" CssClass="checkboxGroup1" Text="全选当前页" runat="server"/>
               <%-- <asp:CheckBox ID="AllPage" OnClick="CheckChange(this)" CssClass="checkboxGroup2" Text="全选所有" runat="server"/>--%>
            </span>&nbsp;&nbsp;
            <%--<a onclick="searchForm();" id="MainHolder_btnSearch" class="linkbtn _searchBtn" href="#"><span>查询</span></a>--%>
            <asp:LinkButton CssClass="linkbtn _searchBtn" ID="btnSearch" OnClick="btnSearch_Click" runat="server"><span>查询</span></asp:LinkButton>
            <a class="linkbtn" href="javascript:exportData();"><span>数据导出</span></a>
            <asp:LinkButton CssClass="linkbtn" ID="uploadBtn" OnClientClick="uploadTemplate();return false;" runat="server"><span>数据导入</span></asp:LinkButton><%--onclick="ExportClick"--%>
            <a class="linkbtn" ID="addBtn"  runat="server"  href="javascript:openForm('New','','');"><span>新增综合资料</span></a>
            <%--<asp:LinkButton CssClass="linkbtn" ID="LinkButton2" OnClientClick="openForm('New','');return false;" runat="server"><span>新增基本信息</span></asp:LinkButton><%--onclick="ExportClick"--%>
            <asp:LinkButton CssClass="linkbtn" ID="btnPrint" PostBackUrl="PrintLabels.aspx" runat="server"><span>打印标签</span></asp:LinkButton><%--OnClick="PrintClick"--%>
            <a onclick="destory();" ID="destoryBtn"  runat="server" class="linkbtn _searchBtn" href="#"><span>销毁</span></a>            
        </div>
        <div style="overflow-x:auto;overflow-y:auto;width:100%;height: 390px">
            <!----------- 数据列表 ------------------>
            <asp:GridView ID="baseInfoList" runat="server" class="dg_borderstyle" AutoGenerateColumns="False" 
                CellPadding="0" CellSpacing="1" border="0" ShowHeaderWhenEmpty="true" OnRowCommand="DealCommand" 
                AlternatingRowStyle-CssClass="dg_alternatingitemstyle" AllowSorting="True" OnSorting="GridView1_Sorting"
                RowStyle-CssClass="dg_itemstyle" onrowdatabound="baseInfoList_RowDataBound">
                <HeaderStyle CssClass="dg_headerstyle"></HeaderStyle>
                <Columns>
                    <asp:BoundField DataField="BaseInfoID" HeaderText="综合资料编号" Visible="false"/>
                    <asp:TemplateField ItemStyle-Width="20px">
                        <ItemTemplate>
                            <input id="chkItem" class="_selectItem" runat="server" type="checkbox" value='<%# DataBinder.Eval(Container, "DataItem.ArchivesID").ToString()%>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:HyperLinkField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataNavigateUrlFields="BaseInfoID,ArchivesID" DataNavigateUrlFormatString="/Modules/ArchivesManagement/ZHArchForm.aspx?id={0}&action=View&archInfoId={1}"
                        DataTextField="BoxCode" HeaderText="档案盒编号" Target="_blank" SortExpression="BoxCode"/>
                    <asp:BoundField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataField="BoxPosition" HeaderText="所在位置" SortExpression="BoxPosition"/>
                    <asp:HyperLinkField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataNavigateUrlFields="BaseInfoID,ArchivesID" DataNavigateUrlFormatString="/Modules/ArchivesManagement/ZHArchForm.aspx?id={0}&action=View&archInfoId={1}"
                        DataTextField="Name" HeaderText="档案名称" Target="_blank" SortExpression="Name"/>
                    <asp:TemplateField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" HeaderText="所属年度"  SortExpression="BelongYear">
                        <ItemTemplate>
                            <%# Eval("BelongYear")%>年<%--<%#Eval("BelongMonth")%>月--%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataField="InitDate" HeaderText="形成日期" DataFormatString="{0:yyyy-MM-dd}" HtmlEncode="False" SortExpression="InitDate"/>
                    <asp:BoundField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataField="CustodyBeginDate" HeaderText="保管起始日期" DataFormatString="{0:yyyy-MM-dd}" HtmlEncode="False" SortExpression="CustodyBeginDate"/>
                    <asp:BoundField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataField="CustodyYear" HeaderText="保管年限" SortExpression="CustodyYear"/>  
                    <asp:BoundField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataField="CustodyEndDate" HeaderText="到期日期" DataFormatString="{0:yyyy-MM-dd}" HtmlEncode="False" SortExpression="CustodyEndDate"/>
                    <asp:BoundField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" DataField="PageCount" HeaderText="张数" SortExpression="PageCount"/>
                     <asp:TemplateField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" HeaderText="是否销毁" SortExpression="IsDestroy">
                        <ItemTemplate>
                            <%# Eval("IsDestroy").ToString()=="True"?"是":"否" %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField  ItemStyle-Wrap="False" HeaderStyle-Wrap="False" HeaderText="操作">
                        <ItemTemplate>
                            <a href='<%#"javascript:openForm(\"Edit\",\"" + Eval("BaseInfoID") + "\",\"" + Eval("ArchivesID") + "\")"%>'><span>编辑</span></a>
                            <a href='<%#"javascript:uploadFile(\"" + Eval("ArchivesID") + "\")"%>'><span>上传附件</span></a>
                            <asp:LinkButton CommandArgument='<%#Eval("BaseInfoID")+","+Eval("ArchivesID") %>' OnClientClick="return deleteConfirm();" CommandName="DeleteArchInfo" runat="server" ID="btnDelete"><span>删除</span></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <!--分页-->
            <table width="100%">
                <tr>                    
                    <td Width="85%">
                        <diy:AspNetPager ID="pager" runat="server" AlwaysShow="true" OnPageChanged="pager_PageChanged"
                            Width="100%" ShowPageIndexBox="Always" PageIndexBoxType="TextBox" TextBeforePageIndexBox="转到"
                            TextAfterPageIndexBox="页" ShowCustomInfoSection="Left" CustomInfoHTML="总数：%RecordCount%，共 %PageCount% 页，当前为第%CurrentPageIndex%页"
                            HorizontalAlign="right" FirstPageText="首页" PrevPageText="上页" NextPageText="下页"
                            LastPageText="末页" CssClass="dg_pagestyle" PageSize="15">
                        </diy:AspNetPager>    
                    </td>
                    <td Width="15%">，每页<asp:TextBox ID="PageSize" runat="server" style="width: 30px" Text="15" onblur="CheckPageSize(this)"></asp:TextBox>条记录。</td>
                </tr>
            </table>
            </div>
            <div id="loading" style="display:none">
	            <table><tr><td><img src='/Themes/Default/images/loading.gif'/></td>
                <td style="word-break:keep-all; background-color:">数据处理中...</td></tr>
                </table>
            </div>
            <div id="returnMessage" style="display:none;">
                <div style="width:100%;height: 320px"><span id="messageContent"> </span></div>
            </div>
    </div>
    </ContentTemplate>
    <Triggers>
        <%--<asp:PostBackTrigger ControlID="lbtnAddMember" />
        <asp:PostBackTrigger ControlID="lbtnExport" />--%>
    </Triggers>
    </asp:UpdatePanel>             
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"
        DynamicLayout="true">
        <ProgressTemplate>
            <uc1:Loading ID="Loading1" runat="server" />
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:LinkButton CssClass="linkbtn" ID="exportBtn" OnClick="ExportClick" runat="server" style="display: none"><span>数据导出</span></asp:LinkButton>
</asp:Content>
